using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Afrs.Draco.Prms.Client.Proxy;
using Afrs.Prms.DataObject;

namespace 
{
  /// <summary>
  /// ReportsDetailedFolders Test Class
  /// </summary>
  [TestClass]
  public class TestReportsDetailedFolders
  {
    #region Class Variables
    private CdoPrms<DOReportsDetailedFolders>		m_ReportsDetailedFolders;
    private CdoPrmsList<DOReportsDetailedFolders>	m_AllReportsDetailedFolders;
    #endregion

    #region Class Constructors & Destructors
    /// <summary>
    /// Constructs the test
    /// </summary>
    public TestReportsDetailedFolders()
    {
      // Create the data objects
      this.m_ReportsDetailedFolders	= new CdoPrms<DOReportsDetailedFolders>();
      this.m_AllReportsDetailedFolders	= new CdoPrmsList<DOReportsDetailedFolders>();
    }
    #endregion

    #region Class Methods
    /// <summary>
    /// Retrieves all ReportsDetailedFolders data objects
    /// </summary>
    [TestMethod]
    public void ReportsDetailedFoldersRetrieveAll()
    {
      // Set up the data object for list retrieval
      this.m_AllReportsDetailedFolders.DataObject = new DOReportsDetailedFolders();
      this.m_AllReportsDetailedFolders.ListAction = AfrsDOListAction.Retrieve;

      // Perform the action and determine the success
      if (!this.m_AllReportsDetailedFolders.PerformAction())
      {
        // Assert the errors
        if (this.m_AllReportsDetailedFolders.Errors.Count > 0) { Assert.Fail(this.m_AllReportsDetailedFolders.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }

    /// <summary>
    /// Create a new ReportsDetailedFolders
    /// </summary>
    [TestMethod]
    public void ReportsDetailedFoldersCreate()
    {
      // Set up the data object for creation
      this.m_ReportsDetailedFolders.DataObject.d_folder = "Test d_folder";
      this.m_ReportsDetailedFolders.DataObject.d_loc = "Test d_loc";
      this.m_ReportsDetailedFolders.DataObject.d_user = "Test d_user";
      this.m_ReportsDetailedFolders.DataObject.doctype = 'b';
      this.m_ReportsDetailedFolders.DataObject.d_status = "Test d_status";
      this.m_ReportsDetailedFolders.DataObject.d_datetime = DateTime.Now;
      this.m_ReportsDetailedFolders.DataObject.LOCNO = 'b';
      this.m_ReportsDetailedFolders.DataObject.FSTATUS = 'b';
      this.m_ReportsDetailedFolders.DataObject.barcode = 'b';
      this.m_ReportsDetailedFolders.DataObject.d_accno = "Test d_accno";
      this.m_ReportsDetailedFolders.DataObject.Action = AfrsDataObjectAction.Create;

      // Perform the action and determine the success
      if (!this.m_ReportsDetailedFolders.PerformAction())
      {
        // Assert the errors
        if (this.m_ReportsDetailedFolders.Errors.Count > 0) { Assert.Fail(this.m_ReportsDetailedFolders.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }

    /// <summary>
    /// Retrieves a specific ReportsDetailedFolders
    /// </summary>
    [TestMethod]
    public void ReportsDetailedFoldersRetrieve()
    {
      // Determine whether the data object needs to be specified
      if (this.m_ReportsDetailedFolders.DataObject.Id == 0)
      {
        // Specify the data object to retrieve
        this.m_ReportsDetailedFolders.DataObject.FILENO = 'b';
      }

      // Set up the data object action for retrieval
      this.m_ReportsDetailedFolders.DataObject.Action = AfrsDataObjectAction.Retrieve;

      // Perform the action and determine the success
      if (!this.m_ReportsDetailedFolders.PerformAction())
      {
        // Assert the errors
        if (this.m_ReportsDetailedFolders.Errors.Count > 0) { Assert.Fail(this.m_ReportsDetailedFolders.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }
    #endregion
  }
}
